package edu.wayne.cs.csc4110.hw6.framework.plugin;

import java.awt.Component;

import javax.swing.JList;
import javax.swing.plaf.basic.BasicComboBoxRenderer;


public class PluginComboBoxRenderer extends BasicComboBoxRenderer {
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean cellHasFocus) {
		super.getListCellRendererComponent(list, value, index, isSelected,
				cellHasFocus);

		if (value != null) {
			ActivePlugin plugin = (ActivePlugin) value;
			setText(plugin.getGameTitle());
		}

		return this;
	}
}
